<template>
  <div id="balance_recharge" >
    <diyBackGround :style="{'background-image': `linear-gradient(${theme_color}, #f5f5f5)`}"></diyBackGround>
    <div class="main" :style="bannerInfo.banner?'margin-top: -9.5938rem;':''">
      <div v-if="bannerInfo.banner" class="banner" @click="bannerTo">
        <img :src="bannerInfo.banner"  alt=""/>
      </div>
      <div class="detailBox">
        <div class="zhbanlace">
          <div class="title">让利会员ID</div>
          <input type="text" v-model="query.store_profit_uid" placeholder="请输入让利会员ID" @blur="storeChange" />
        </div>
        <ul class="personal_info" v-if="username">
          <li>
            <span>会员昵称：</span>
            <span>{{ username }}</span>
          </li>
        </ul>
        <div class="zzPrice">
          <div class="title">让利金额</div>
          <div class="priceInpBox">
            <span class="symbol">{{$i18n.t("money")}}</span>
            <input type="number" v-model="query.store_profit_price" placeholder="0.00" @input="priceCange"  />
          </div>
        </div>
        <div class="img">
          <h3>消费凭证</h3>
          <div class="imgflex" >
            <van-uploader :after-read="onRead" multiple>
              <div class="another" v-if="query.store_profit_image">
                  <img :src="query.store_profit_image"  mode="widthFix" />
                  <i @click="removeImg_1(index)" class="iconfont icon-icon_close"></i>
                </div>
              <div class="photoshow" v-else>
                <div class="crucifix"></div>
              </div>
            </van-uploader>
          </div>
        </div>
        <div class="btn" @click="profitsConfirm">确认</div>
      </div>
      <p class="notes">
      </p>
    </div>
  </div>
</template>
<script>
import profits_controller from "./profits_controller";
export default profits_controller;
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" rel="stylesheet/scss" scoped>
#balance_recharge {
  .main {
    margin: 0 0.625rem;
    margin-top: -5.5938rem;
    .banner {
      width: 100%;
      height: auto;
      img {
        max-width: 100%;
        height: auto;
        border-radius: 10px;
        display: block;
      }
    }

    .txt {
      text-align: left;
      margin-left: 0.4063rem;
    }

    .detailBox {
      margin-top: 0.9375rem;
      background: #fff;
      box-shadow: 0 0.0625rem 0.25rem 0 rgba(7, 11, 33, 0.11);
      border-radius: 0.3125rem;
      padding: 1.25rem 1.3438rem;
      padding-top: 0;

      .btn {
        height: 2.4375rem;
        background: #f15353;
        border-radius: 0.375rem;
        font-size: 0.9688rem;
        text-align: center;
        line-height: 2.4375rem;
        color: #fff;
      }

      .zzPrice {
        margin:1rem 0 2rem 0;

        .title {
          font-size: 0.8125rem;
          color: #333;
          text-align: left;
          position: relative;
          padding:0 0 0 4px;
          &::after {
            content:'*';
            color:red;
            position: absolute;
            left:-2px;
            top:0px;
          }
        }

        .priceInpBox {
          border-bottom: 1px solid #f5f6f8;
          padding-top: 1.5625rem;
          // padding-bottom: 0.8438rem;
          display: flex;
          position: relative;
          .priceTxt {
            line-height: 2.5rem;
            font-size: 0.9375rem;
          }
          .symbol {
            position: absolute;
            z-index: 1;
            bottom: 4px;
            left:0;
            color: #626262;
          }

          input {
            height: 100%;
            flex: 1;
            border: none;
            width: 15.625rem;
            margin-left: 1rem;
            font-size: 1.5625rem;
          }
        }
      }

      .zhbanlace {
        height: 2.9063rem;
        display: flex;
        align-items: center;

        .title {
          flex-shrink: 0;
          font-size: 0.8125rem;
          color: #333;
          position: relative;
          padding:0 0 0 4px;
          &::after {
            content:'*';
            color:red;
            position: absolute;
            left:-2px;
            top:0px;
          }
        }

        input {
          height: 100%;
          flex: 1;
          border: none;
          width: 15.625rem;
          margin-left: 1rem;
          border-bottom: #f5f6f8 1px solid;
        }
      }

      .personal_info {
        width: 100%;
        background: #fff;
        display: flex;

        font-size: 0.8rem;
        color: #f15353;
        margin-top: 0.5625rem;

        li {
          display: flex;
          font-size: 14px;
          text-align: left;

          span:first-child {
            display: block;
            color: #333;
          }
        }

        li:last-child {
          padding: 0 0 0 0.25rem;
          // margin-left: 0.625rem;
        }
      }
    }
    .img {
      h3 {
        text-align: left;
        font-weight: 400;
      }
      padding:0 0 20px 0;
    }
    .another {
      border-radius: 5px;
      position: relative;
      .icon-icon_close {
        padding:5px;
        background-color: #F0F0F1;
        font-size: 10px;
        border-radius: 50%;
        right:-5px;
        top:-5px;
        z-index: 5;
        position: absolute;
      }
    }
    .imgflex {
      display: flex;
      // justify-content: flex-end;
      flex-wrap: wrap;
      align-items: center;
      margin-top: 0.75rem;
      width: 120px;
      height: 120px;

      .photoshow {
        border-radius: 2px;
        width: 120px;
        height: 120px;
        border: 0.0313rem dashed rgb(192, 204, 218);
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
      }

      .crucifix {
        /* 十字架样式 */
        width: 30px;
        height: 0.125rem;
        background: #b2b2b2;
        border-radius: 0.0313rem;
        position: relative;

        &::after {
          content: "";
          width: 30px;
          height: 0.125rem;
          background: #b2b2b2;
          border-radius: 0.0313rem;
          position: absolute;
          transform: rotate(-90deg);
          left: 0;
        }
      }

      img {
        width: 120px;
        height: 120px;
        border-radius: 5px;
      }
    }
  }

  #wrapper {
    margin-top: 0.625rem;
  }
}
</style>
